readBytes

open suspend override fun readBytes(buffer: ByteArray): Int

Reads data from the serial port until the provided buffer is filled.

Return

Number of bytes read from the serial port

Parameters

buffer

ByteArray to fill with data from the serial port

Throws

TimeoutCancellationException

If operation takes longer than the time specified by the readTimeout